using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;

namespace BizTalk.BuildGenerator.UI
{
    public partial class Host : Form
    {
        public Host()
        {
            InitializeComponent();
        }

        private void ShowNewForm(object sender, EventArgs e)
        {
            WizardForm frm = new WizardForm();
            frm.MdiParent = this;
            frm.Show();
        }

        private void OpenFile(object sender, EventArgs e)
        {
            OpenWizardForm frm = new OpenWizardForm(this);
            frm.MdiParent = this;
            frm.Show();
        }


        private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }


        private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.Cascade);
        }

        private void TileVerticleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

        private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.ArrangeIcons);
        }

        private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form childForm in MdiChildren)
            {
                childForm.Close();
            }
        }

        private void contentsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string path = AppDomain.CurrentDomain.BaseDirectory + @"\Build Generator.mht";
            if (File.Exists(path))
                Process.Start(path);
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ApplicationAboutBox frm = new ApplicationAboutBox();
            frm.ShowDialog();
        }
    }
}